﻿using ApplicationModels.A02.Identities;
using DomainCommons.Models;

namespace ApplicationModels.A07.Chats
{
    public class ConversationAM : BaseEntity<int>
    {
        /// <summary>
        /// 参与会话的用户
        /// </summary>
        public List<string> ParticipantIds { get; set; } = new List<string>();
        /// <summary>
        /// 最新的一条消息
        /// </summary>
        public string? LastMessage { get; set; }
        /// <summary>
        /// 最后更新的时间
        /// </summary>
        public DateTime LastUpdated { get; set; }
        /// <summary>
        /// 是否显示
        /// </summary>
        public List<string> DisplayIds { get; set; } = new List<string>();
        public string? SenderId { get; set; }
        public string? ReceiverId { get; set; }
        public string? ReceiverName { get; set; }
        public string? ReceiverAvatar { get; set; }
        public ConversationAM(string id1,string id2,string lastMessage)
        {
            ParticipantIds.Add(id1);
            ParticipantIds.Add(id2);
            LastMessage = lastMessage;
            LastUpdated = DateTime.Now;
        }
        public ConversationAM() { }
    }
}
